package jUnitTest;

import org.junit.Test;

import depot.DimensionFormatException;
import depot.DuplicateIDException;
import depot.IDFormatException;
import depot.Parcel;
import depot.ParcelMap;;

public class ParcelTest {
	
	/**
	 * This method tests if the IDFormatException works well
	 * @throws IDFormatException
	 * @throws DimensionFormatException
	 */
	@Test(expected = IDFormatException.class)
	public void testIDFormat() throws IDFormatException, DimensionFormatException {
		//if (Parcel)
		Parcel parcel3 = new Parcel("G407",5,3.6,"5x7x8");
		Parcel parcel5 = new Parcel("L221",7,2.9,"4x6x9");
		Parcel parcel7 = new Parcel("L22x",6,9.88,"5x4.6x7");
	}
	
	/**
	 * This method tests if the DimensionFormatException works well
	 * @throws IDFormatException
	 * @throws DimensionFormatException
	 */
	@Test(expected = DimensionFormatException.class)
	public void testDimension() throws IDFormatException, DimensionFormatException {
			Parcel parcel4 = new Parcel("N882",3,2.6,"3x9.8");
			Parcel parcel6 = new Parcel("N334",1,6.4,"3x6.47x9");
			Parcel parcel8 = new Parcel("L778",8,4.6,"ex5x10");
	}

}
